package com.dmjj.limit.service.impl;

import com.dmjj.common.base.BaseMapper;
import com.dmjj.common.base.BaseServiceImpl;
import com.dmjj.limit.dao.RoleScopeMapper;
import com.dmjj.limit.dto.RoleScopeDTO;
import com.dmjj.limit.service.RoleScopeService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;
import java.util.List;


/**
 * 角色-数据范围业务处理接口
 * @Author zhangxue
 * @Date 2019-03-22 14:39:44
 */
@Service
public class RoleScopeServiceImpl extends BaseServiceImpl<RoleScopeDTO, Long> implements RoleScopeService {

    private static final Log LOGGER = LogFactory.getLog(RoleScopeServiceImpl.class);

    @Autowired
    private RoleScopeMapper mapper;

    @Override
    protected BaseMapper<RoleScopeDTO, Long> getMapper() {
        return mapper;
    }

    /**
     * 角色-数据范围列表
     * @Author zhangxue
     * @Date 2019-03-22 14:39:44
     * @Param
     * @Return
     */
    @Override
    public List<RoleScopeDTO> list4Page(RoleScopeDTO entity, Integer pageNum, Integer... pageSize) {
        return super.list4Page(entity, pageNum, pageSize);
    }

    /**
     * 角色-数据范围列表（无分页）
     * @Author zhangxue
     * @Date 2019-03-22 14:39:44
     * @Param
     * @Return
     */
    @Override
    public List<RoleScopeDTO> listByCondition(RoleScopeDTO entity) {
        return super.listByCondition(entity);
    }

    /**
     * 查询角色-数据范围详情信息
     * @Author zhangxue
     * @Date 2019-03-22 14:39:44
     * @Param
     * @Return
     */
    @Override
    public RoleScopeDTO queryOneByPk(Long id) {
        return super.queryOneByPk(id);
    }

    /**
     * 保存角色-数据范围信息
     * @Author zhangxue
     * @Date 2019-03-22 14:39:44
     * @Param
     * @Return
     */
    @Override
    @Transactional
    public Long save(RoleScopeDTO entity) {
        return super.save(entity);
    }

    /**
     * 删除角色-数据范围信息
     * @Author zhangxue
     * @Date 2019-03-22 14:39:44
     * @Param
     * @Return
     */
    @Override
    @Transactional
    public Integer delete(Long id) {
        return super.delete(id);
    }

    /**
     * 修改角色-数据范围实体类信息
     * @Author zhangxue
     * @Date 2019-03-21 09:40:56
     * @Param
     * @Return
     */
    @Override
    public Integer update(RoleScopeDTO entityDTO) {
        return mapper.update(entityDTO);
    }
}
